//
//  Merchant.m
//  EasyToo
//
//  Created by 郑 哲 on 9/6/13.
//
//

#import "Merchant.h"

@implementation Merchant

- (id)initWithDictionary:(NSDictionary *)merchantDic
{
    self = [self init];
    if (self) {
        self.merchantId = GetDictionaryStringDefaultNil(merchantDic, @"merchantId");
        self.address = GetDictionaryStringDefaultNil(merchantDic, @"address");
        self.brand = GetDictionaryStringDefaultNil(merchantDic, @"brand");
        self.name = GetDictionaryStringDefaultNil(merchantDic, @"name");
        self.phone = GetDictionaryStringDefaultNil(merchantDic, @"phone");
        self.telephone = GetDictionaryStringDefaultNil(merchantDic, @"telephone");
        self.email = GetDictionaryStringDefaultNil(merchantDic, @"email");
        self.imageUrl = GetDictionaryStringDefaultNil(merchantDic, @"logo");
        if (!self.merchantId) {
            self.merchantId = GetDictionaryStringDefaultNil(merchantDic, @"id");
        }
        if (!self.imageUrl) {
            self.imageUrl = GetDictionaryStringDefaultNil(merchantDic, @"imgUrl");
        }
   }
    return self;
}



@end
